package zdream.pmfield.stage.buff.ailment;

import zdream.pmfield.data.foe.MoveAdditionalEffects;
import zdream.pmfield.stage.buff.foe.FoeStageBuff;
import zdream.pmfield.stage.buff.foe.TypeBuff;
import zdream.pmfield.stage.director.HookType;
import zdream.pmfield.stage.object.FoeActor;

/**
 * <p>潮湿状态下, 几乎所有状态免疫都会失效, 包括:
 * </p>
 * <li>{@link TypeBuff} 中描述的属性免疫状态, 比如电免疫麻痹, 火免疫烧伤等
 * </li>
 *
 * <p>
 * 潮湿效果能自然恢复, 3 轮之后投骰子判断是否恢复.
 * 主要通过 {@link zdream.pmfield.data.foe.VStat#LUCK} 来决定是否恢复.
 * </p>
 *
 * @author Zdream
 * @date 2023-12-03
 * @since 0.0.1
 */
public class WetBuff extends FoeStageBuff {
	public static final String CATEGORY = MoveAdditionalEffects.E_WET;
	public final BuffSpan span;

	public WetBuff(FoeActor target) {
		super(target);
		span = new DurationBuffSpan()
				.withMinDuration(3)
				.withStartTime(now());
	}

	@Override
	public void init() {
		preventSameBuffBeforeFoeReceiveBuff();
		onHook(HookType.BEFORE_FOE_TURN_START)
				.handle(span::checkIsNeedCured)
				.buildAndSave();
	}

	@Override
	public String getCategory() {
		return CATEGORY;
	}

	@Override
	public String toString() {
		return "潮湿";
	}
}
